package com.kk.util.test.thread;

/**
 * @author: kevin
 * @data: 2018-09-07 09:12
 * @desc:
 */
public class Thread1 extends Thread {
    private String name;

    public Thread1(String name) {
        this.name = name;
    }
    public void run() {
        for (int i = 0; i < 5; i++) {
            System.out.println("运行"+this.name+": "+i);
        }
    }
    public static void main(String[] args){
        new Thread1("A").start();
        new Thread1("B").start();

        //start方法被重复调用，java.lang.IllegalThreadStateException异常
//        Thread t1 = new Thread1("c");
//        Thread t2 = t1;
//        t1.start();
//        t2.start();

    }
}

